<template>
  <div class="col-md-8">
    <h3 class="reply">评论回复：</h3>
    <h2 style='display: none'>暂无评论，点击左侧添加评论！！！</h2>
    <ul class="list-group">
      <item v-for="(comment, index) in comments" :key="index" :comment="comment" :delItem="del"></item>
    </ul>
  </div>
</template>

<script>
import Item from './Item'
export default {
  props: {
    comments: Array, // 接收父组件传递的数据
    delItem: { // 接收父组件传递的函数
      type: Function,
      required: true
    }
  },
  components: {
    Item
  },
  methods: {
    del (comment) {
      this.delItem(comment)
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .reply {
    margin-top: 0px;
  }
</style>
